Formius.Helper = $.inherit({}, {
	/**
	* @param Mixed value
	* @return Boolean
	*/
	isNumber: function(value) {
		return (typeof(value) === 'number' || (typeof(value) === 'string') && value !== '' && !isNaN(value));
	},
	/**
	* @param Mixed value
	* @return Boolean
	*/
	isObject: function(value) {
		if(value instanceof Array) {
			return false;
		} else {
			return (value !== null) && (typeof(value) == 'object');
		}
	},
	/**
	 * @param String from
	 * @param String to
	 * @param String where
	 * @return String
	 */
	replace: function(from, to, where) {
		return ('' + where).replace(new RegExp(from, 'g'), to);
	},
	/**
	 * Checks if a value exists in an array
	 * 
	 * @param Mixed needle
	 * @param Array haystack
	 * @param Boolean strict
	 * @return Boolean
	 * 
	 * @author Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	 * @author Sergey Larionov (http://larionov.biz)
	 */
	inArray: function(needle, haystack, strict) {
		strict = !!strict;
		for (var key in haystack) {
			if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
				return true;
			}
		}
		return false;
	},
	extend: function(source, target) {
		return $.extend(true, target, $.extend(true, {}, source || {}, target || {}));
	}
});
